# -*- coding: utf-8 -*-
"""
自定义管道组件
"""

import os
import ppc
import ppc.pipe


class XlsWriter(ppc.pipe.Pipe):
    """写入到文件内容"""

    def handle(self):
        filename = self['filename'].value
        with open(filename, 'a+') as f:
            d = []
            for v in self.input.values():
                d.append(v)
            f.write("\t".join(d))
            f.write("\n")

        self.transfer(input)
